Skip to content

Conversation

@rhamilt
Copy link
Contributor

@rhamilt rhamilt commented Jul 13, 2025

This PR contains updates for miscellaneous features related to the new Lambda quick edit.

Handling of empty directories

Problem

Previously, having an empty directory in the Lambda quick edit flow led to errors when trying to view the function code in the explorer or in a workspace. An empty folder could be the result of an error during download. The unintended bug in the code was related to how we were checking for existence of a function saved locally.

Solution

Check if there are any files in the directory before determining if it exists locally. If the directory is empty, we must redownload the code (a Lambda function cannot be empty, so we know it is unintended)

README updates

Problem

  • A couple typographic errors
  • README was opening as separate tab, not as split pane
  • README was referencing "cloud deploy icon" rather than showing the actual icon, same with the invoke icon

Solution

  • Fix errors
  • Adjust README open to use markdown.showPreviewToSide
  • Save the icons locally so we can display them in the actual README.

Quick Edit Flow updates

Problem

  • Some non-passive metrics were being emitted on activation
  • Downloading code on activation lead to race conditions with authentication
  • Downloading code on activation lead to extra slow load times

Solution

All of this is fixed by moving things around so that there is never any code downloaded during activation. This is beneficial because it keeps us from doing a lot of our main functionality on activation.

Previously, opening a function in a workspace, which could be done through a URI handler or from the explorer, would cause the extension to restart. Once the extension restarted, at that point we would download the code and start the watchers. These changes download the code first, and only start the watchers on activation. Because the user doesn't need to be authenticated to start the watchers (only to deploy), this is not an issue for being authenticated. If it's a workspace folder, we're assuming the function exists locally, so that's why we know we've downloaded the code already.

The only edge case is if the local code is out of sync with what's in the cloud; in this case, we prompt the user to overwrite their code, but they need to go to the explorer to manually download it to avoid the activation race conditions.


  • Treat all work as PUBLIC. Private feature/x branches will not be squash-merged at release time.
  • Your code changes must meet the guidelines in CONTRIBUTING.md.
  • License: I confirm that my contribution is made under the terms of the Apache 2.0 license.

@rhamilt rhamilt changed the title Lambda updates feat(lambda): Updates for Lambda quick edit Jul 13, 2025
@rhamilt rhamilt marked this pull request as ready for review July 14, 2025 06:31
@rhamilt rhamilt requested a review from a team as a code owner July 14, 2025 06:31
@github-actions
Copy link

  • This pull request implements a feat or fix, so it must include a changelog entry (unless the fix is for an unreleased feature). Review the changelog guidelines.
    • Note: beta or "experiment" features that have active users should announce fixes in the changelog.
    • If this is not a feature or fix, use an appropriate type from the title guidelines. For example, telemetry-only changes should use the telemetry type.

@rhamilt rhamilt changed the title feat(lambda): Updates for Lambda quick edit fix(lambda): Updates for Lambda quick edit Jul 14, 2025
}

// Delete all files in the directory
await deleteFilesInFolder(workspacePath)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this confirm deleted all data in folder but didn't download anything?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we want to clear the folder so that next time we try to open the code, editLambda knows it needs to redownload the freshest code.

@laileni-aws laileni-aws enabled auto-merge (squash) July 14, 2025 18:27
@laileni-aws laileni-aws merged commit 7dc982c into aws:master Jul 14, 2025
30 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants